package org.tigris.scarab.model;

/**
 * Enum to define the type of an activity on the tracker.
 * */
public enum ActivityTypeEnum {

    ISSUE_REMINDER("ISSUE_REMINDER", "ActivityTypeIssueReminder", "NotificationIssueReminder", 19),
    ISSUE_ONHOLD("ISSUE_ONHOLD", "ActivityTypeIssueOnHold", "NotificationIssueOnHold", 18),
    ISSUE_CREATED("ISSUE_CREATED", "ActivityTypeIssueCreated", "NotificationIssueCreated", 17),
    ISSUE_MOVED("ISSUE_MOVED", "ActivityTypeIssueMoved", "NotificationIssueMoved", 16),
    ISSUE_COPIED("ISSUE_COPIED", "ActivityTypeIssueCopied", "NotificationIssueCopied", 15),
    ISSUE_DELETED("ISSUE_DELETED", "ActivityTypeIssueDeleted", "NotificationIssueDeleted", 14),
    ATTRIBUTE_CHANGED("ATTRIBUTE_CHANGED", "ActivityTypeAttributeChanged", "NotificationAttributeChanged", 13),
    USER_ATTRIBUTE_CHANGED("USER_ATTRIBUTE_CHANGED", "ActivityTypeUserAttributeChanged", "NotificationUserAttributeChanged", 12),
    URL_ADDED("URL_ADDED", "ActivityTypeURLAdded", "NotificationURLAdded", 11),
    URL_CHANGED("URL_CHANGED", "ActivityTypeURLChanged", "NotificationURLCHanged", 10),
    URL_DESC_CHANGED("URL_DESC_CHANGED", "ActivityTypeURLDescChanged", "NotificationURLDESCCHanged", 9),
    URL_DELETED("URL_DELETED", "ActivityTypeURLDeleted", "NotificationURLDeleted", 8),
    ATTACHMENT_CREATED("ATTACHMENT_CREATED", "ActivityTypeAttachmentCreated", "NotificationAttachmentCreated", 7),
    ATTACHMENT_REMOVED("ATTACHMENT_REMOVED", "ActivityTypeAttachmentRemoved", "NotificationAttachmentRemoved", 6),
    DEPENDENCY_CREATED("DEPENDENCY_CREATED", "ActivityTypeDependencyCreated", "NotificationDependencyCreated", 5),
    DEPENDENCY_CHANGED("DEPENDENCY_CHANGED", "ActivityTypeDependencyChanged", "NotificationDependencyChanged", 4),
    DEPENDENCY_DELETED("DEPENDENCY_DELETED", "ActivityTypeDependencyDeleted", "NotificationDependencyDeleted", 3),
    COMMENT_ADDED("COMMENT_ADDED", "ActivityTypeCommentAdded", "NotificationCommentAdded", 2),
    COMMENT_CHANGED("COMMENT_CHANGED", "ActivityTypeCommentChanged", "NotificationCommentChanged", 1),
    OTHER("OTHER", "ActivityTypeOther", "NotificationIssueOther", 0);

    
    private final String value;
    private final String resourceId;
    private final String notificationKey; //key to get i10n message
    private final int notificationPriority;

    ActivityTypeEnum(String value, String resourceId, String notificationKey, int notificationPriority) {
        this.value = value;
        this.resourceId = resourceId;
        this.notificationKey = notificationKey;
        this.notificationPriority = notificationPriority;
    }

    public String value() {
        return value;
    }

    /**
     * Used as key in the localization properties files.
     */
    public String notificationKey() {
        return notificationKey;
    }

    public int priority() {
        return notificationPriority;
    }

    public String resourceId(String code) {
        return resourceId;
    }
}
